<?php
class Top extends CComponent{
	
	public function init(){
		
	}
	
	/**
	 * 获取最受欢迎音频排行
	 */
	public function getTopLikeAudio(){
		$criteria = new CDbCriteria();
		$criteria -> order ="audio_likes desc";
		$criteria -> limit = 10;
		return Audios::model() -> findAll($criteria);
	}
	
	/**
	 * 播放最多音频排行
	 */
	public function getTopPlayAudio(){
		$criteria = new CDbCriteria();
		$criteria -> order ="audio_playtimes desc";
		$criteria -> limit = 10;
		return Audios::model() -> findAll($criteria);
	}
	
	/**
	 * 订阅排名
	 */
	public function getTopSubcribe(){
		$criteria = new CDbCriteria();
		$criteria -> order ="eduer_subscribes desc";
		$criteria -> limit = 10;
		return Educators::model() -> findAll($criteria);
	}
}